﻿using PhuLeBooze.UICode;
using PhuLeBussinessObject.CContact;
using PhuLeDao.Contact;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PhuLeBooze
{
    public partial class contact : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
                ltrCompanyName.Text = CConfigSiteEntity.CompanyName;

                CAgencyctDao agencyDao = new CAgencyctDao();
                IList<CAgency> list = agencyDao.GetList("<InputValue Context='FrontEnd'/>");
                StringBuilder htmlValue = new StringBuilder();
                //<p>180-192 Nguyễn Công Trứ , P. Nguyễn Thái Bình , Q.1 , TP. HCM - <b>[M]</b> 0906 841 288 - <b>[E]</b> cskh@phulebrandy.com</p>
                var i = 0;
                foreach (CAgency item in list) {
                    htmlValue.Append("<p class='spara'>");
                    
                    if (i == 0)
                        htmlValue.AppendFormat("<b >{0}</b>:<br/>", item.Code);
                    else
                        htmlValue.AppendFormat("<b >{0}</b>:<br/>", item.Code);

                    if (item.AddressVN != "") {
                        htmlValue.AppendFormat("<b>Địa chỉ</b>: {0}<br>", item.AddressVN);
                    }
                    if (item.Phone != "")
                    {
                        htmlValue.AppendFormat("<b>Điện thoại</b>: {0}", item.Phone);
                    }
                    if (item.Email != "")
                    {
                        htmlValue.AppendFormat(" - <b>Email</b>: {0}", item.Email);
                    }
                    htmlValue.Append("</p>");
                }
                ltrAgency.Text = htmlValue.ToString();

            }
        }
    }
}